package gold.digger;

import java.util.*;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC412 {
    public long startExecuteTime = System.currentTimeMillis();


    public List<String> fizzBuzz(int n) {
        List<String> list = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            list.add(getCurStr(i));
        }

        return list;
    }

    public String getCurStr(int num) {
        if (num % 3 == 0 && num % 5 == 0) {
            return "FizzBuzz";
        }

        if (num % 3 == 0) {
            return "Fizz";
        }

        if (num % 5 == 0) {
            return "Buzz";
        }

        return String.valueOf(num);
    }


    public static void main(String[] args) throws Exception {
        LC412 an = new LC412();
        System.out.println(an.fizzBuzz(15));

        System.out.println("\nanswer total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
